﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace Autocentro.Entities
{
    public class COMPRAS:BaseEntity
    {
        public COMPRAS()
        {
            DetalleCompra = new List<DETALLECOMPRA>();
            Fecha = DateTime.Now.Date;
        }

        public int Id { get; set; }

        [Display(Name = "IdProveedor")]
        [Required(ErrorMessage = "El proveedor es requerido")]
        [Range(1, 100000, ErrorMessage = "Debe cargar los datos completos del Proveedor")]
        public int IdProveedor { get; set; }

        [Display(Name = "NroGuia")]
        [Required(ErrorMessage = "El número de Guía es requerido")]    
        public string NroGuia { get; set; }

        [Display(Name = "Fecha")]
        [Required(ErrorMessage = "La fecha es requerida")]    
        public DateTime? Fecha { get; set; }

        [Display(Name = "Total")]
        [Required(ErrorMessage = "El Total es requerido")]
        [Range(0.001, 100000, ErrorMessage = "El Total debe ser mayor a 0")]
        public decimal Total { get; set; }

        public PROVEEDOR Proveedor { get; set; }
        public List<DETALLECOMPRA> DetalleCompra { get; set; }


    }
}
